<template>
	<div>
		<el-form ref="form" :model="form" label-width="80px">
			
		  <el-form-item label="类型">
		    <el-input v-model="form.DictTypeName"></el-input>
		  </el-form-item>
		 
		  <el-form-item>
		    <el-button type="primary" @click="onSubmit">立即添加</el-button>
		    <el-button type="primary" @click="quxiao">取消</el-button>
		  </el-form-item>
		</el-form>
		
	</div>
</template>

<script>
import DictTypeApi from '@/api/DicttypeApi.js'
	 export default {
	    data() {
	      return {
	        form: {
	          DictTypeName: ''
	       	      
	        }
	      }
	    },
	    methods: {
	      onSubmit() {
	        DictTypeApi.add(this.form).then(res=>{
				if (res.code==1) {
					console.log(res);
					this.$message({
						message:"添加成功",
						type:"success"
					})
					this.$emit('close')
				}			
			})
	      },
		  quxiao(){
		  	this.$emit('close')
		  }
	    }
	  }
</script>

<style>
</style>